package com.itzsj.common.result;

import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
public class Result {

    private Integer code;
    private String message;
    private Object data;

    public Result(Integer code, String message, Object data) {
        this.code = code;
        this.message = message;
        this.data = data;
    }

    public static Result success() {
        return new Result(1, null, null);
    }

    public static  Result success(Object data) {
        return new Result(1, null, data);
    }

    public static Result error(String message) {
        return new Result(0, message, null);
    }

}
